package cn.tedu.spring2205.week01.demo02.service.impl;

import cn.tedu.spring2205.week01.demo02.dao.AnimalDao;
import cn.tedu.spring2205.week01.demo02.dao.BearDao;
import cn.tedu.spring2205.week01.demo02.dao.CatDao;
import cn.tedu.spring2205.week01.demo02.service.CatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("catService")
public class CatServiceImpl implements CatService {

    /**
     * 字段注入
     */
    @Autowired
    private CatDao catDao;

    private AnimalDao animalDao;

    private BearDao bearDao;

    //使用set方法注入对象
    @Autowired
    public void setBearDao(BearDao bearDao){
        this.bearDao = bearDao;
    }

    @Autowired
    public CatServiceImpl(AnimalDao animalDao){
        this.animalDao = animalDao;
    }

    @Override
    public CatDao getCatDao() {
        return this.catDao;
    }

    @Override
    public AnimalDao getAnimalDao() {
        return this.animalDao;
    }

    @Override
    public BearDao getBearDao() {
        return this.bearDao;
    }
}
